<?php
/**
 * Created by PhpStorm.
 * User: Lee
 * Date: 2019/1/9
 * Time: 11:08
 */

namespace app\article\controller;


use app\article\model\Article;
use think\Request;

class Index
{
    //显示所有文章数据
    public function showAll(){
        $result = Article::get(1);
        return $result;
    }
    //保存文章
    public function save(){
        //验证输入

        //保存文章
        $article = new Article();
        $article -> article = input('post.text');
        $result = $article -> save();
        //返回结果
        return $result;
    }
}